/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.util;

import Apusic.*;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see Apusic.ApusicPackage
 * @generated
 */
public class ApusicSwitch<T>
{
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static ApusicPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ApusicSwitch()
  {
    if (modelPackage == null)
    {
      modelPackage = ApusicPackage.eINSTANCE;
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  public T doSwitch(EObject theEObject)
  {
    return doSwitch(theEObject.eClass(), theEObject);
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(EClass theEClass, EObject theEObject)
  {
    if (theEClass.eContainer() == modelPackage)
    {
      return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else
    {
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
      return
        eSuperTypes.isEmpty() ?
          defaultCase(theEObject) :
          doSwitch(eSuperTypes.get(0), theEObject);
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(int classifierID, EObject theEObject)
  {
    switch (classifierID)
    {
      case ApusicPackage.APUSIC_SERVER:
      {
        ApusicServer apusicServer = (ApusicServer)theEObject;
        T result = caseApusicServer(apusicServer);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.APPLICATION_MANAGER:
      {
        ApplicationManager applicationManager = (ApplicationManager)theEObject;
        T result = caseApplicationManager(applicationManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.THREAD_POOL_MANAGER:
      {
        ThreadPoolManager threadPoolManager = (ThreadPoolManager)theEObject;
        T result = caseThreadPoolManager(threadPoolManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.DATA_SOURCE_MANAGER:
      {
        DataSourceManager dataSourceManager = (DataSourceManager)theEObject;
        T result = caseDataSourceManager(dataSourceManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.ADVANCE_SERVICE_MANAGER:
      {
        AdvanceServiceManager advanceServiceManager = (AdvanceServiceManager)theEObject;
        T result = caseAdvanceServiceManager(advanceServiceManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.SYSTEM_SERVICE_MANAGER:
      {
        SystemServiceManager systemServiceManager = (SystemServiceManager)theEObject;
        T result = caseSystemServiceManager(systemServiceManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_TOPIC_MANAGER:
      {
        JMSTopicManager jmsTopicManager = (JMSTopicManager)theEObject;
        T result = caseJMSTopicManager(jmsTopicManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_QUEUE_MANAGER:
      {
        JMSQueueManager jmsQueueManager = (JMSQueueManager)theEObject;
        T result = caseJMSQueueManager(jmsQueueManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_FACTORY_MANAGER:
      {
        JMSFactoryManager jmsFactoryManager = (JMSFactoryManager)theEObject;
        T result = caseJMSFactoryManager(jmsFactoryManager);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JVM:
      {
        JVM jvm = (JVM)theEObject;
        T result = caseJVM(jvm);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.OS:
      {
        OS os = (OS)theEObject;
        T result = caseOS(os);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.APPLICATION:
      {
        Application application = (Application)theEObject;
        T result = caseApplication(application);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.DATA_SOURCE:
      {
        DataSource dataSource = (DataSource)theEObject;
        T result = caseDataSource(dataSource);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.ACP_CFG:
      {
        ACPCfg acpCfg = (ACPCfg)theEObject;
        T result = caseACPCfg(acpCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.AJP_CFG:
      {
        AJPCfg ajpCfg = (AJPCfg)theEObject;
        T result = caseAJPCfg(ajpCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.EJB_CFG:
      {
        EJBCfg ejbCfg = (EJBCfg)theEObject;
        T result = caseEJBCfg(ejbCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.THREAD_POOL:
      {
        ThreadPool threadPool = (ThreadPool)theEObject;
        T result = caseThreadPool(threadPool);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.TRANSACTION_CFG:
      {
        TransactionCfg transactionCfg = (TransactionCfg)theEObject;
        T result = caseTransactionCfg(transactionCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.MUXER_CFG:
      {
        MuxerCfg muxerCfg = (MuxerCfg)theEObject;
        T result = caseMuxerCfg(muxerCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.LOGGING_CFG:
      {
        LoggingCfg loggingCfg = (LoggingCfg)theEObject;
        T result = caseLoggingCfg(loggingCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.HTTP_SESSION_CFG:
      {
        HttpSessionCfg httpSessionCfg = (HttpSessionCfg)theEObject;
        T result = caseHttpSessionCfg(httpSessionCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.HTTP_SESSION_STORE_CFG:
      {
        HttpSessionStoreCfg httpSessionStoreCfg = (HttpSessionStoreCfg)theEObject;
        T result = caseHttpSessionStoreCfg(httpSessionStoreCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.HTTP_WEB_CFG:
      {
        HttpWebCfg httpWebCfg = (HttpWebCfg)theEObject;
        T result = caseHttpWebCfg(httpWebCfg);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_FACTORY:
      {
        JMSFactory jmsFactory = (JMSFactory)theEObject;
        T result = caseJMSFactory(jmsFactory);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_QUEUE:
      {
        JMSQueue jmsQueue = (JMSQueue)theEObject;
        T result = caseJMSQueue(jmsQueue);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ApusicPackage.JMS_TOPIC:
      {
        JMSTopic jmsTopic = (JMSTopic)theEObject;
        T result = caseJMSTopic(jmsTopic);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Server</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Server</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseApusicServer(ApusicServer object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Application Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Application Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseApplicationManager(ApplicationManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Thread Pool Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Thread Pool Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseThreadPoolManager(ThreadPoolManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Data Source Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Data Source Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDataSourceManager(DataSourceManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Advance Service Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Advance Service Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseAdvanceServiceManager(AdvanceServiceManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>System Service Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>System Service Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseSystemServiceManager(SystemServiceManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Topic Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Topic Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSTopicManager(JMSTopicManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Queue Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Queue Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSQueueManager(JMSQueueManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Factory Manager</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Factory Manager</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSFactoryManager(JMSFactoryManager object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JVM</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JVM</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJVM(JVM object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>OS</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>OS</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOS(OS object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Application</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Application</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseApplication(Application object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Data Source</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Data Source</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDataSource(DataSource object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>ACP Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>ACP Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseACPCfg(ACPCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>AJP Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>AJP Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseAJPCfg(AJPCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>EJB Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>EJB Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseEJBCfg(EJBCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Thread Pool</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Thread Pool</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseThreadPool(ThreadPool object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Transaction Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Transaction Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTransactionCfg(TransactionCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Muxer Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Muxer Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseMuxerCfg(MuxerCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Logging Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Logging Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseLoggingCfg(LoggingCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Http Session Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Http Session Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseHttpSessionCfg(HttpSessionCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Http Session Store Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Http Session Store Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseHttpSessionStoreCfg(HttpSessionStoreCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Http Web Cfg</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Http Web Cfg</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseHttpWebCfg(HttpWebCfg object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Factory</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Factory</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSFactory(JMSFactory object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Queue</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Queue</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSQueue(JMSQueue object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>JMS Topic</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>JMS Topic</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseJMSTopic(JMSTopic object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch, but this is the last case anyway.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject)
   * @generated
   */
  public T defaultCase(EObject object)
  {
    return null;
  }

} //ApusicSwitch
